home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_07
/
v7n7055a.txt
< prev
next >
Wrap
Text File
|
1989-09-03
|
611b
|
26 lines
Listing 2:
#include <stdio.h>
#define IOBYTE_ADDRESS 0X03
#define IOBYTE_SET_FOR_PARALLEL 0X00
#define IOBYTE_SET_FOR_SERIAL 0X80
main()
/* Toggles the IOBYTE */
{
unsigned char *pc = (char *) IOBYTE_ADDRESS;
if (*pc !== IOBYTE_SET_FOR_PARALLEL)
{
printf("\n Changing from Serial to Parallel \n");
*pc = IOBYTE_SET_FOR_PARALLEL;
}
else
{
printf("\n Changing from Parallel to Serial \n");
*pc = IOBYTE_SET_FOR_SERIAL;
}
exit(0);
}